home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 2.8 KB | 96 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: ToolFacet.h
- // Release Version: $ 1.0d1 $
- //
- // Author: Henri Lamiraux
- // Creation Date: 3/28/94
- //
- // Copyright: © 1993, 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef TOOLFACET_H
- #define TOOLFACET_H
-
- #ifndef DRAWPART_H
- #include "DrawPart.h"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWFACET_H
- #include "FWFacet.h"
- #endif
-
- // ----- Graphic Includes -----
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWPAT_H
- #include "FWPat.h"
- #endif
-
- //==============================================================================
- // Constants
- //==============================================================================
-
- const short kNbRects = 9;
-
- //==============================================================================
- // Forward Declaration
- //==============================================================================
-
- class CDrawPart;
- class FW_CGraphicContext;
-
- //==============================================================================
- // CToolFacet
- //==============================================================================
-
- class CToolFacet : public FW_CFacet
- {
- //------------------------------------------------------------------------------
- // Initialization/destruction
- //------------------------------------------------------------------------------
- public:
- CToolFacet();
- void InitToolFacet(XMPFacet* facet, CDrawPart* drawPart);
- virtual ~CToolFacet();
-
- //------------------------------------------------------------------------------
- // Inherited
- //------------------------------------------------------------------------------
- public:
- virtual void Draw(FW_CGraphicContext *gc);
-
- virtual FW_Boolean DoMouseDown(const FW_CPoint& where,
- XMPEventData event);
-
- //------------------------------------------------------------------------------
- // New API
- //------------------------------------------------------------------------------
- public:
- void CheckTool(unsigned short oldTool,
- unsigned short newTool);
- void CheckFillFrame(unsigned short oldFillFrame,
- unsigned short newFillFrame);
- void UpdateColors();
-
- private:
- short TestRect(const FW_CPoint& pos, FW_CRect* rects, unsigned short nbRect);
- void InvertTool(FW_CGraphicContext *gc, unsigned short theTool);
- void DrawFillFrame(unsigned short fillFrame, const FW_CPattern& pattern);
- void DrawTools(FW_CGraphicContext *gc);
- void DrawColors(FW_CGraphicContext *gc);
-
- //------------------------------------------------------------------------------
- // Data
- //------------------------------------------------------------------------------
- private:
- CDrawPart* fDrawPart;
- FW_CRect fRects[kNbRects];
- };
- #endif